package com.test.springmvc;

import com.test.entity.User;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.validation.ObjectError;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.validation.Valid;
import java.util.List;


@Controller
public class RegisterCtrl {

    @RequestMapping(value = "/regist")
    public String regist(@Valid User user,BindingResult bs){

        /*model.addAttribute("user",new User());
        List<ObjectError> errorList = rs.getAllErrors();
        System.out.println(user.getUsername());*/
        return "regist";
    }

    @RequestMapping(value = "/registUI")
    public String registUI(){
        return "forward:regist.shtml";
    }
}
